package com.ruoyi.weixin.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 订单详情对象 order_item
 *
 * @author dqianhe
 * @date 2022-04-27
 */
public class OrderItem extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    private String id;

    /**
     * 逻辑删除标记（0：显示；1：隐藏）
     */
    private String delFlag;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号")
    private String orderId;

    /**
     * 商品Id
     */
    @Excel(name = "商品Id")
    private String spuId;

    /**
     * 商品名
     */
    @Excel(name = "商品名")
    private String spuName;

    /**
     * 图片
     */
    @Excel(name = "图片")
    private String picUrl;

    /**
     * 商品数量
     */
    @Excel(name = "商品数量")
    private Long quantity;

    /**
     * 购买单价
     */
    @Excel(name = "购买单价")
    private BigDecimal salesPrice;

    /**
     * 运费金额
     */
    @Excel(name = "运费金额")
    private BigDecimal freightPrice;

    /**
     * 支付金额（购买单价*商品数量+运费金额）
     */
    @Excel(name = "支付金额", readConverterExp = "购=买单价*商品数量+运费金额")
    private BigDecimal paymentPrice;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getSpuId() {
        return spuId;
    }

    public void setSpuId(String spuId) {
        this.spuId = spuId;
    }

    public String getSpuName() {
        return spuName;
    }

    public void setSpuName(String spuName) {
        this.spuName = spuName;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public Long getQuantity() {
        return quantity;
    }

    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getSalesPrice() {
        return salesPrice;
    }

    public void setSalesPrice(BigDecimal salesPrice) {
        this.salesPrice = salesPrice;
    }

    public BigDecimal getFreightPrice() {
        return freightPrice;
    }

    public void setFreightPrice(BigDecimal freightPrice) {
        this.freightPrice = freightPrice;
    }

    public BigDecimal getPaymentPrice() {
        return paymentPrice;
    }

    public void setPaymentPrice(BigDecimal paymentPrice) {
        this.paymentPrice = paymentPrice;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("delFlag", getDelFlag())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("orderId", getOrderId())
                .append("spuId", getSpuId())
                .append("spuName", getSpuName())
                .append("picUrl", getPicUrl())
                .append("quantity", getQuantity())
                .append("salesPrice", getSalesPrice())
                .append("freightPrice", getFreightPrice())
                .append("paymentPrice", getPaymentPrice())
                .append("remark", getRemark())
                .toString();
    }
}
